package o;

import com.huawei.appgallery.agreementimpl.impl.bean.ProtocolQueryResBean;
import com.huawei.appgallery.agreementimpl.impl.bean.UserSignatureStatus;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import java.util.ArrayList;
import java.util.List;
import o.axa.a;

public class ayh implements IServerCallBack {
    private awp ˏ;

    ayh(awp o_awp) {
        this.ˏ = o_awp;
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
        ProtocolQueryResBean protocolQueryResBean = (ProtocolQueryResBean) responseBean;
        aww o_aww = new aww(((axm) o_cvu).ˋ().ˏ().size());
        awy o_awv = new awv();
        if (responseBean != null) {
            o_awv.ˎ(responseBean.getResponseCode());
            o_awv.ˏ(protocolQueryResBean.getRtnCode_());
        }
        if (protocolQueryResBean != null && responseBean.getRtnCode_() == 0 && responseBean.getResponseCode() == 0) {
            axg.ˏ().ˊ("tmsQuery", aye.ॱ);
            List arrayList = new ArrayList();
            if (protocolQueryResBean.ˎ() != null) {
                for (UserSignatureStatus userSignatureStatus : protocolQueryResBean.ˎ()) {
                    axd o_axd = new axd();
                    o_axd.ˎ(userSignatureStatus.ˊ());
                    o_axd.ˊ(userSignatureStatus.ॱॱ());
                    o_axd.ˏ(userSignatureStatus.ˋ());
                    o_axd.ˏ(userSignatureStatus.ˏ());
                    o_axd.ˎ(userSignatureStatus.ˎ());
                    o_axd.ˊ(userSignatureStatus.ॱ());
                    ˊ(userSignatureStatus);
                    arrayList.add(o_axd);
                }
            }
            o_awv.ˋ(arrayList);
        } else {
            if (protocolQueryResBean != null) {
                axg.ˏ().ॱ("207", "code=" + protocolQueryResBean.getErrCause());
            } else {
                axg.ˏ().ॱ("207", "queryResBeanNull");
            }
            aye.ˋ(protocolQueryResBean);
        }
        this.ˏ.ˊ(o_aww, o_awv);
    }

    private void ˊ(UserSignatureStatus userSignatureStatus) {
        if (!"com.huawei.appmarket".equals(fis.ˎ().getPackageName())) {
            return;
        }
        if (ContentManager.getInstant().getContext().getResources().getInteger(a.ˎ) == userSignatureStatus.ˋ()) {
            eua.ˏ().ˎ("protocol_lastest_version_code", userSignatureStatus.ˎ());
        } else if (ContentManager.getInstant().getContext().getResources().getInteger(a.ˊ) == userSignatureStatus.ˋ()) {
            eua.ˏ().ˎ("privacy_lastest_version_code", userSignatureStatus.ˎ());
        }
    }
}
